package com.project.controller;

import com.project.bean.MonthCount;
import com.project.service.ICountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("count")
public class CountController {
    @Autowired
    private ICountService countService;


    @RequestMapping("findCount")
    public Map findCount (LocalDate startDate , LocalDate endDate){
        return countService.findCount(startDate,endDate);
    };

    @RequestMapping("findMonthCount")
    public List<MonthCount> findMonthCount(Integer year){
        return countService.findMonthCount(year);
    };

    @RequestMapping("findYear")
    public Integer[] findYear(){
        return countService.findYear();
    }
}
